Skip to content

feat: add .af line comments - #80

Open
Peyton-Spencer wants to merge 2 commits into
mainfrom
feat-af-comments
Open

feat: add .af line comments#80
Peyton-Spencer wants to merge 2 commits into
mainfrom
feat-af-comments

Conversation

@Peyton-Spencer

Copy link
Copy Markdown
Contributor

Summary

  • Adds first-class single-# line comment tokens for .af files.
  • Preserves comments through formatting and LSP semantic highlighting, while stripping them before AST/codegen output.
  • Keeps Markdown ## headings rendered as normal prompt text to avoid breaking existing templates.

Tests

  • go test ./...

Closes #79 for the comments slice of Phase 1.

Support single-# .af comment lines across tokenization, formatting, codegen, and LSP highlighting while preserving Markdown heading output.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 3, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Peyton-Spencer has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 30 minutes and 6 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e55bb6fb-11c1-4e23-a27c-4fcf480ca20f

📥 Commits

Reviewing files that changed from the base of the PR and between 16ffd2a and f6f75d4.

⛔ Files ignored due to path filters (2)
  • pkg/gen/gogen/testdata/comments_strip/input.golden.af is excluded by !**/gen/**
  • pkg/gen/gogen/testdata/comments_strip/output.golden.go is excluded by !**/gen/**
📒 Files selected for processing (9)
  • README.md
  • pkg/format/format_test.go
  • pkg/lsp/granular_tokens.go
  • pkg/token/coarse/coarse.go
  • pkg/token/coarse/coarse_test.go
  • pkg/token/kind/kind.go
  • pkg/token/kind/kind_string.go
  • pkg/token/token.go
  • pkg/token/token_test.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat-af-comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 30 minutes and 6 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

Avoid treating existing single-# emoji Markdown headings as comments so generated example output stays stable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@Peyton-Spencer Peyton-Spencer left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the tokenizer, coarse-token conversion, formatter, LSP semantic token handling, and codegen golden coverage for the new single-# comment behavior.

No blocking findings. The implementation keeps comments as granular tokens for formatting/LSP, strips them before AST/codegen, and preserves the documented Markdown heading exceptions.

Verification:

  • go test ./... initially failed because the container could not write to the default Go module cache under /home/bun/go/pkg/mod.
  • GOMODCACHE=/tmp/opencode/gomodcache GOPATH=/tmp/opencode/gopath go test ./... passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: next .af syntax surface — comments, .doc, .var modifiers, iteration, raw blocks

1 participant